

//数值类型
var bejin_salary = 30319;
var javasvript_hot = 68.28;
var java_cost = bejin_salary*javasvript_hot/100;

console.log(java_cost);

//字符串类型
var desp = "北京1-3年工作经验平均薪资";

//数值 ->字符
var string1 = fe_beijin_salary + "";

//isNaN
console.log(isNaN(string1));

//字符->数值
var number1 = paraseInt(string1);

//浮点数用parseFloat

console.log('parseInt后的type'+typeof(number1));

//数组

var city_salary = new Objection();
city_salary.city = 'bijing';
city_salary.position = 'fe';
city_salary.salary_min = 19422;
city_salary.salary_max = 30919;

console.log(city_salary);

var city_salary2 ={
  city = 'bijing',
  position = 'fe',
  salary_min = 19422,
  salary_max = 30919,
};
console.log(city_salary2);

//解构赋值
let{city,position} = city_salary;

//构造函数
class salaryData{
  constructor(city,position,salary_max,salary_min){
    this.city = city;
    this.position = position;
    this.salary_max = salary_max;
    this.salary_min = salary_min;
  }
  avg_salary(){
    return(this.salary_min + this.salary_max)/2;
  }
}

//调用
var sh_fe = new salaryData('shanghai','fe',14398,24675);
console.log(sh_fe.avg_salary());

//继承
class captialSlalryData extends salaryData{
  constructor(city,position,salary_max,salary_min){
    super(city,position,salary_max,slalry_min);
  }
  pure_income(){
    return this.avg_salary()*0.65;
  }
}

//this
function showTitle(o){
  console.log(this.title);
}

showTitle({title:'fangtang'});

//使用call或者apply
showTitle.call({title:'fangtang1'});
showTitle.apply({title:'fangtang2'});

//bind
